package com.inno.thread.hello;

import java.util.concurrent.*;

/**
 * 创建带有返回值的任务
 *
 * @author May
 * @time 2020/3/25 21:35
 * @see
 */
class CallableInBook implements Callable<String> {
    private int id;

    public CallableInBook(int id) {
        this.id = id;
    }

    public String call() {
        return "result of CallableTask " + id;
    }
}

public class CallableDemoInBook {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newCachedThreadPool();
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5, 20, 0L, TimeUnit.MILLISECONDS,
                new LinkedBlockingQueue<Runnable>());

    }
}
